package com.ericsson.enap.modules.cdr.job;

import com.ericsson.common.quartz.job.MainJob;
import com.ericsson.common.quartz.job.ManualQuartzJob;
import com.ericsson.common.quartz.service.QuartzTableManager;
import com.ericsson.enap.modules.cdr.task.VgcCdrDownloadTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * 5GC 话单下载
 * @author yanghai
 * 2021-04-16
 * nohup java -jar vgcCdrDownload.jar >/dev/null 2>&1 &
 */
@Lazy(true)
@Component
public class VgcCdrDownloadJob implements MainJob {

    @Autowired
    QuartzTableManager quartzTableManager;
    @Autowired
    VgcCdrDownloadTask vgcCdrDownloadTask;

    String jobName="vgcCdrDownloadJob";

    @Override
    public void doTask() {
        System.out.println("VgcCdrDownloadJob start.....");
        //vgcCdrDownloadTask.execute();
        quartzTableManager.addManualTaskJob(jobName,jobName,jobName,jobName, ManualQuartzJob.class,"0 0/5 * * * ?",vgcCdrDownloadTask);
    }
}
